package gui;

import java.awt.Dimension;
import java.awt.TextArea;

import javax.swing.BorderFactory;
import javax.swing.JButton;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ConsultaEscola extends javax.swing.JPanel {
	private JLabel consultaEscola;
	private TextArea areaDados;
	private JButton botaoVoltar;
	private JLabel caixaMaiorUm;
	private JLabel campoMenor;
	private JButton alterar;

	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.getContentPane().add(new ConsultaEscola());
		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		frame.pack();
		frame.setVisible(true);
	}
	
	public ConsultaEscola() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.setPreferredSize(new java.awt.Dimension(800, 600));
			this.setSize(800, 600);
			this.setLayout(null);
			this.setBackground(new java.awt.Color(204,204,255));
			{
				consultaEscola = new JLabel();
				this.add(consultaEscola);
				consultaEscola.setText("Consultar Dados da Escola");
				consultaEscola.setFont(new java.awt.Font("Arial",0,36));
				consultaEscola.setBounds(184, 5, 446, 43);
				consultaEscola.setForeground(new java.awt.Color(0,102,102));
				consultaEscola.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
			}
			{
				areaDados = new TextArea();
				this.add(areaDados);
				areaDados.setBounds(92, 123, 311, 239);
				areaDados.setFont(new java.awt.Font("Arial",0,18));
				areaDados.setEditable(false);
				areaDados.setText(GerenciadorDeJanelas.escola.toString());
			}
			{
				alterar = new JButton();
				this.add(alterar);
				alterar.setText("Alterar Dados");
				alterar.setBounds(523, 179, 173, 22);
				alterar.setFont(new java.awt.Font("Arial",2,18));
				alterar.setBackground(new java.awt.Color(255,255,255));
				alterar.addMouseListener(new java.awt.event.MouseAdapter() {
		            public void mouseClicked(java.awt.event.MouseEvent evt){
		                try{
		                	alterarMouseClicked(evt);}
		                catch(Exception e){
		                	System.out.println(e.getMessage());
		                }
		            }
		        });
			}
			{
				botaoVoltar = new JButton();
				this.add(botaoVoltar);
				botaoVoltar.setText("Voltar");
				botaoVoltar.setBounds(523, 247, 173, 22);
				botaoVoltar.setFont(new java.awt.Font("Arial",2,18));
				botaoVoltar.setBackground(new java.awt.Color(255,255,255));
				botaoVoltar.addMouseListener(new java.awt.event.MouseAdapter() {
		            public void mouseClicked(java.awt.event.MouseEvent evt){
		                try{
		                	voltarMouseClicked(evt);}
		                catch(Exception e){
		                	System.out.println(e.getMessage());
		                }
		            }
		        });
			}
			{
				caixaMaiorUm = new JLabel();
				this.add(caixaMaiorUm);
				caixaMaiorUm.setBounds(38, 91, 718, 469);
				caixaMaiorUm.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
				caixaMaiorUm.setBackground(new java.awt.Color(255,255,255));
			}
			{
				campoMenor = new JLabel();
				this.add(campoMenor);
				campoMenor.setBounds(440, 102, 34, 446);
				campoMenor.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void alterarMouseClicked (java.awt.event.MouseEvent evt){
		GerenciadorDeJanelas.window.setVisible(false);
		GerenciadorDeJanelas.alteraEscola = new AlteraEscola();
        GerenciadorDeJanelas.window.setContentPane(GerenciadorDeJanelas.alteraEscola);
        GerenciadorDeJanelas.window.setVisible(true);
		
	}
	
    public void voltarMouseClicked (java.awt.event.MouseEvent evt){
    	GerenciadorDeJanelas.window.setVisible(false);
        GerenciadorDeJanelas.window.setContentPane(GerenciadorDeJanelas.menuAltera);
        GerenciadorDeJanelas.window.setVisible(true);
		
	}
	
	
	

}
